package com.atguigu.realtime.function;

import com.atguigu.realtime.util.IkUtil;
import org.apache.flink.table.annotation.DataTypeHint;
import org.apache.flink.table.annotation.FunctionHint;
import org.apache.flink.table.functions.TableFunction;
import org.apache.flink.types.Row;

@FunctionHint(output = @DataTypeHint("row<keyword string>"))
public class IkAnalyzer extends TableFunction<Row> {
    public void eval(String kw ){
        // 实现分词
        for (String word : IkUtil.split(kw)) {
            collect(Row.of(word));
        }

    }
}
